import styled from "@emotion/styled"

const CardContainer = styled.div`
    background: linear-gradient(90deg, #ff547e 0%, #ff7070 100%);
    border-radius: 8rem;
    padding: 12rem 16rem;
    color: white;
    height: 100%;
    width: 100%;
`

const CardTitle = styled.div`
    font-family: Gilroy;
    font-weight: 700;
    font-size: 16rem;
    line-height: 24rem;
    letter-spacing: 0%;
    color: #ffffff;
    margin-bottom: 12rem;
`

const ValueRoot = styled.div`
    display: flex;
    align-items: center;
    justify-content: space-between;
`

const PointsValue = styled.div`
    font-family: Gilroy;
    font-weight: 500;
    font-size: 32rem;
    line-height: 48rem;
`

const DetailsButton = styled.button`
    background: linear-gradient(90deg, #ffe4c8 0%, #ffc184 100%);
    color: #cb360e;
    border: none;
    border-radius: 20rem;
    cursor: pointer;
    width: 114rem;
    height: 40rem;
    font-family: Gilroy;
    font-weight: 700;
    font-size: 14rem;
    line-height: 20rem;
    text-align: center;
`

interface PointsCardProps {
    points: number
}

const PointsCard: React.FC<PointsCardProps> = ({ points }) => {
    return (
        <CardContainer>
            <CardTitle>My Points</CardTitle>
            <ValueRoot>
                <PointsValue>{points.toLocaleString()}</PointsValue>
                <DetailsButton>Details</DetailsButton>
            </ValueRoot>
        </CardContainer>
    )
}

export default PointsCard
